package shop.ibatis;

import java.io.IOException;
import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import JoinDAO.JoinVO;


public class JoinSqlMapper {
	 private static SqlSessionFactory JoinSqlMapper;
		static {
		   try {
		      Reader reader = Resources.getResourceAsReader("shop/ibatis/SqlMapConfig.xml");
		      JoinSqlMapper = new SqlSessionFactoryBuilder().build(reader);
		      reader.close(); 
		    } catch (IOException e) {
		      throw new RuntimeException("Something bad happened while building the SqlMapClient instance." + e, e);
		    }
		  }
		 
	public static void Join_insert (JoinVO vo) {	  
		  SqlSession session = JoinSqlMapper.openSession();
		  session.insert("Insert", vo);
		  session.commit();
	}
	
	public static void Member_update(JoinVO vo){
		SqlSession session = JoinSqlMapper.openSession();
		session.update("Member_update", vo);
		session.commit();
	}

	public static void join_delete(JoinVO vo) {
		SqlSession session = JoinSqlMapper.openSession();
		session.delete("join_delete", vo);
		session.commit();
	}


	
	
		
}